package com.parenting.sevice.impl;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.parenting.entities.Feedback;
import com.parenting.mapper.FeedbackMapper;
import com.parenting.response.FeedbackImgVO;
import com.parenting.response.FeedbackVO;
import com.parenting.sevice.FeedbackImgService;
import com.parenting.sevice.FeedbackService;
import com.parenting.util.base.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * 意见反馈 服务实现类
 * </p>
 *
 * @author zcj
 * @since 2021-05-26
 */
@Service
public class FeedbackServiceImpl extends ServiceImpl<FeedbackMapper, Feedback> implements FeedbackService {

    @Autowired
    private FeedbackImgService feedbackImgService;


    @Override
    public Result<Page<FeedbackVO>> pageList(Integer current, Integer size) {
        Page<FeedbackVO> page = new Page<>(current, size);
        Page<FeedbackVO> pageList = baseMapper.getPageList(page);
        return Result.ok(pageList);
    }

    @Override
    public Result<List<FeedbackImgVO>> imgList(Integer id) {
        List<FeedbackImgVO> list = feedbackImgService.imgList(id);
        return Result.ok(list);
    }


}
